<!-- Eric800t 实验平台的线路图 -->
<template>
    <div class="E800tSvgClass" id="E800tSvg" :style="{ background: bgColor }" @contextmenu.prevent="showMenu">
        <svg xmlns="http://www.w3.org/2000/svg" version="1.1" :width="width" :height="height">
            <!-- transform="translate(0 0)  scale(0.6)" -->
            <defs>
                <!-- 线路标签 -->
                <g id="c-txtTitle">
                    <rect x="0" y="0" rx="4" ry="4" width="100" height="26" :fill="titleBgColor" />
                </g>
                <!-- PT标签 -->
                <g id="c-ptTitle">
                    <circle cx="10" cy="10" r="12" :fill="titleBgColor" />
                </g>
                <!-- CT标签 -->
                <g id="c-ctTitle">
                    <circle cx="10" cy="10" r="12" :fill="ctBgColor" />
                </g>
                <!-- 开关的标签 -->
                <g id="c-kgTitle">
                    <rect x="0" y="0" rx="4" ry="4" width="40" height="20" :fill="kgBgColor" />
                </g>
                <!-- 手车开关的标签 -->
                <g id="c-sckgTitle">
                    <rect x="0" y="0" rx="4" ry="4" width="40" height="20" fill="red" />
                </g>
                <!-- 可控硅的标签 -->
                <g id="c-kkgTitle">
                    <polygon points="8,0 22,0 30,12 22,24 8,24 0,12 8,0" :fill="kgBgColor" />
                </g>
                <!-- 开关的“X”标识 width="10" height="10" 引用时对连接点 x-5-->
                <g id="c-kg-x">
                    <line x1="5" y1="0" x2="5" y2="5" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="0" y1="0" x2="10" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="10" y1="0" x2="0" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 缩小的开关的“X”标识-->
                <g id="c-sskg-x" transform="scale(0.6)">
                    <line x1="0" y1="0" x2="10" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="10" y1="0" x2="0" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 开关的“d”标识 引用时对连接点 x-7-->
                <g id="c-kg-d">
                    <line x1="7" y1="0" x2="7" y2="7" :stroke="componentColor" :stroke-width="lineWidth" />
                    <path d="M 7 7 A 3 3 0 1 1 7 2" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                </g>
                <g id="c-banyuan-shang">
                    <!-- 半径9 开口向下的半圆 -->
                    <path d="M 0 0 A 9 9 0 1 1 19 0" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                </g>
                <g id="c-banyuan-xia">
                    <!-- 半径9 开口向上的半圆 -->
                    <path d="M 19 0 A 9 9 0 1 1 0 0" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                </g>
                <g id="c-jiedi">
                    <line x1="8" y1="0" x2="8" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="0" y1="10" x2="16" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="3" y1="14" x2="13" y2="14" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="6" y1="18" x2="10" y2="18" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 两横号 -->
                <g id="c-dd">
                    <line x1="6" y1="0" x2="6" y2="5" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="0" y1="5" x2="12" y2="5" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="0" y1="11" x2="12" y2="11" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 灯泡型：圆+X  x-10,y-2 -->
                <g id="c-ox">
                    <circle cx="10" cy="10" r="8" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <line x1="4" y1="4" x2="16" y2="16" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="16" y1="4" x2="4" y2="16" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 三角形 -->
                <g id="c-sanjiao">
                    <polygon points="8,0 14,7 2,7" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- y型 -->
                <g id="c-y">
                    <line x1="7" y1="9" x2="13" y2="12" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="20" y1="9" x2="13" y2="12" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="13" y1="19" x2="13" y2="12" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 倒y型 -->
                <g id="c-dy">
                    <line x1="10" y1="1" x2="10" y2="9" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="5" y1="14" x2="10" y2="9" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="17" y1="14" x2="10" y2="9" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- U型 -->
                <g id="c-u">
                    <polyline points="12,10 9,16 18,16 16,10" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 开关上方短横 x-10 -->
                <g id="c-dh">
                    <line x1="0" y1="0" x2="20" y2="0" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 开关 width="4" height="30" 引用时对连接点 x-2 -->
                <g id="c-kg">
                    <rect x="0" y="0" width="4" height="25" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="0" y="0" width="4" height="25" fill="green" :stroke="componentColor"
                        :stroke-width="lineWidth" transform="translate(-1 -3) rotate(-45,3 30)" />
                </g>
                <g id="c-kg-off">
                    <rect x="0" y="0" width="4" height="25" fill="red" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 手工开关：可接收开关状态，无法远程控制 -->
                <g id="c-sgkg">
                    <rect x="0" y="0" width="4" height="25" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="-15" y="-10" width="4" height="25" fill="green" :stroke="componentColor"
                        :stroke-width="lineWidth" transform="rotate(-90)" />
                    <rect x="0" y="11" width="4" height="4" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <g id="c-sgkg-off">
                    <rect x="0" y="0" width="4" height="25" fill="red" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="0" y="11" width="4" height="4" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 缩小的开关  -->
                <g id="c-sskg" transform="scale(0.6)">
                    <rect x="0" y="0" width="4" height="25" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="0" y="0" width="4" height="25" fill="green" :stroke="componentColor"
                        :stroke-width="lineWidth" transform="translate(-1 -3) rotate(-45,3 30)" />
                </g>
                <g id="c-sskg-off" transform="scale(0.6)">
                    <rect x="0" y="0" width="4" height="25" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="-15" y="-10" width="4" height="25" fill="green" :stroke="componentColor"
                        :stroke-width="lineWidth" transform="rotate(-90)" />
                    <rect x="0" y="11" width="4" height="4" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 熔断器 width="4" height="20" 引用时对连接点 x-2 -->
                <g id="c-rongduan">
                    <line x1="3" y1="0" x2="3" y2="20" :stroke="componentColor" :stroke-width="lineWidth" />
                    <rect x="0" y="0" width="6" height="20" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 电阻 width="4" height="20" 引用时对连接点 x-2 -->
                <g id="c-dianzu">
                    <rect x="0" y="0" width="6" height="20" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 原件001/双绕阻变压器 width="10" height="30" 引用时对连接点 x-1  -->
                <g id="c-001">
                    <circle cx="10" cy="10" r="10" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <circle cx="10" cy="25" r="10" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <line x1="5" y1="8" x2="10" y2="13" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="15" y1="8" x2="10" y2="13" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="5" y1="23" x2="10" y2="28" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="15" y1="23" x2="10" y2="28" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- CT 1个绕组 引用时对连接点 x-8 y+5  -->
                <g id="c-002-1">
                    <polygon points="8,0 14,7 2,7" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <circle cx="8" cy="22" r="10" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <line x1="18" y1="22" x2="35" y2="22" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="32" y1="12" x2="25" y2="33" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- CT 2个绕阻 x-10  -->
                <g id="c-002-2">
                    <circle cx="10" cy="10" r="10" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <line x1="20" y1="10" x2="35" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="28" y1="2" x2="21" y2="22" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="34" y1="2" x2="27" y2="22" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 绕阻组 4个绕组 缩小0.6 -->
                <g id="c-ss002-2" transform="scale(0.5)">
                    <circle cx="10" cy="10" r="10" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <line x1="20" y1="10" x2="35" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="28" y1="2" x2="21" y2="22" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="34" y1="2" x2="27" y2="22" :stroke="componentColor" :stroke-width="lineWidth" />
                </g>
                <!-- 避雷针 x-8 -->
                <g id="c-003">
                    <line x1="8" y1="0" x2="8" y2="5" :stroke="componentColor" :stroke-width="lineWidth" />
                    <polygon points="5,5 8,13 11,5" :fill="componentColor" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <rect x="2" y="2" width="12" height="20" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <use href="#c-jiedi" x="0" y="22" />
                </g>
                <!--两横+灯泡型+接地  x-8 -->
                <g id="c-004">
                    <use href="#c-dd" x="2" y="0" />
                    <line x1="8" y1="11" x2="8" y2="17" :stroke="componentColor" :stroke-width="lineWidth" />
                    <use href="#c-ox" x="-2" y="15" />
                    <use href="#c-jiedi" x="0" y="33" />
                </g>
                <g id="c-ss004" transform="scale(0.5)">
                    <use href="#c-dd" x="2" y="0" />
                    <line x1="8" y1="11" x2="8" y2="17" :stroke="componentColor" :stroke-width="lineWidth" />
                    <use href="#c-ox" x="-2" y="15" />
                    <use href="#c-jiedi" x="0" y="33" />
                </g>
                <!-- 两个大三角长边错位对称  x-18 -->
                <g id="c-005">
                    <polyline points="60,0 17,0 29,23 38,0" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polyline points="17,23 57,23 47,0 38,23 25,35 7,35" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <circle cx="3" cy="36" r="4" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <text x="8" y="46" :fill="componentColor" font-size="10">G</text>
                </g>
                <!-- 电风扇 -->
                <g id="c-006">
                    <polyline points="18,2 26,10 19,19" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polyline points="4,27 8,16 19,19" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polyline points="34,27 21,28 19,19" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <circle cx="19" cy="19" r="18" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <text x="30" y="-10" :fill="componentColor" font-size="10">DKSC</text>
                    <text x="30" y="1" :fill="componentColor" font-size="10">-180-10.5</text>
                </g>
                <!-- 间隙接地 -->
                <g id="c-007">
                    <polygon points="0,0 10,0 5,9" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polygon points="5,13 10,22 0,22" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- XDC-60\10.5   -->
                <g id="c-008">
                    <line x1="1" y1="22" x2="14" y2="10" :stroke="componentColor" :stroke-width="lineWidth" />
                    <polygon points="13,9 15,11 24,1" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polyline points="2,12 12,12 12,22" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <path d="M 2 12 A 10 10 0 1 0 12 2" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <text x="25" y="10" :fill="componentColor" font-size="10">XDC-60\10.5</text>
                </g>
                <!-- KP   -->
                <g id="c-009">
                    <polygon points="12,0 34,0 23,19" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <line x1="10" y1="19" x2="34" y2="19" :stroke="componentColor" :stroke-width="lineWidth" />
                    <line x1="0" y1="5" x2="10" y2="11" :stroke="componentColor" :stroke-width="lineWidth" />
                    <polyline points="10,9 23,19 9,12 11,9" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <text x="32" y="15" :fill="componentColor" font-size="10">KP</text>
                </g>
                <!-- 三个圆圈   -->
                <g id="c-010">
                    <circle cx="24" cy="12" r="12" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <use href="#c-y" x="11" y="0" />
                    <circle cx="13" cy="30" r="12" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <use href="#c-y" x="0" y="18" />
                    <circle cx="35" cy="30" r="12" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <use href="#c-u" x="22" y="18" />
                    <polyline points="24,12 67,12 67,52" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <use href="#c-jiedi" x="59" y="52" />
                    <text x="18" y="55" :fill="componentColor" font-size="10">YH</text>
                </g>
                <!-- 电阻+斜线 -->
                <g id="c-011">
                    <use href="#c-dianzu" x="4" y="1" />
                    <polyline points="13,1 13,4 1,18 1,21" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <text x="13" y="15" :fill="componentColor" font-size="10">HDB</text>
                </g>
                <!-- 最左边的 -->
                <g id="c-012">
                    <polyline points="32,50 32,0" fill="transparent" :stroke="componentColor"
                        :stroke-width="masterLineWidth" />
                    <circle cx="32" cy="73" r="23" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <circle cx="32" cy="107" r="23" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <polygon points="1,93 68,51 56,61 54,57 68,51" :fill="componentColor" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <use href="#c-dy" x="22" y="65" />
                    <polyline points="23,101 40,101 31,116 23,101" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
                <!-- 右下电容 -->
                <g id="c-dr3k" transform="scale(0.5)">
                    <line x1="0" y1="0" x2="0" y2="100" :stroke="componentColor" :stroke-width="lineWidth" />
                    <text x="-56" y="40" :fill="componentColor" font-size="10">HDB</text>
                    <use href="#c-003" x="-40" y="45" />
                    <polyline points="-32,45 -32,35 32,35 32,85" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <use href="#c-dianzu" x="-3" y="60" />
                    <use href="#c-dd" x="-6" y="100" />
                    <text x="-52" y="120" :fill="componentColor" font-size="10">3000Kvar</text>
                    <line x1="0" y1="111" x2="0" y2="230" :stroke="componentColor" :stroke-width="lineWidth" />
                    <path d="M 32 85 A 5 5 0 1 1 32 94" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <path d="M 32 94 A 5 5 0 1 1 32 103" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <path d="M 32 103 A 5 5 0 1 1 32 112" :stroke="componentColor" :stroke-width="lineWidth"
                        fill="transparent" />
                    <polyline points="0,180 32,180 32,112" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                    <polyline points="-30,215 -30,230 30,230 30,215" fill="transparent" :stroke="componentColor"
                        :stroke-width="lineWidth" />
                </g>
            </defs>
            <!-- 整体布局按照竖向电路分为1~6组-->
            <line id="line001" x1="160" y1="32" x2="440" y2="32" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line002" x1="440" y1="59" x2="1445" y2="59" :stroke="componentColor"
                :stroke-width="masterLineWidth" />
            <line id="line003" x1="247" y1="574" x2="355" y2="574" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line004" x1="525" y1="574" x2="618" y2="574" :stroke="componentColor" :stroke-width="lineWidth" />
            <!--  1xx -->
            <line id="line101" x1="160" y1="32" x2="160" y2="51" :stroke="componentColor" :stroke-width="lineWidth" />
            <polyline points="210,56 210,36 65,36 65,56" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="c-kg-d-32" href="#c-kg-d" x="58" y="56" />
            <use id="c-kg-32" :href="switchShow(32)" data-type="switch" data-num="11" x="63" y="69" />
            <use id="c-kg-title-32" data-type="switch" data-num="32" href="#c-kgTitle" x="52" y="114" />
            <text id="c-kg-txt-32" data-type="switch" data-num="32" x="62" y="129" :fill="titleTxtColor">32</text>
            <rect v-if="viewMode === 2 && form.switch[32]" data-type="switch" data-num="32" x="38" y="66" width="60"
                height="72" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <polyline points="65,94 65,108 95,108 95,46 115,46 115,42 140,42 140,46 " fill="transparent"
                :stroke="componentColor" :stroke-width="lineWidth" />
            <polyline points="115,46 115,50 140,50 140,46 160,46 " fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="122" y="60" :fill="componentColor" font-size="12">R</text>
            <text x="52" y="50" :fill="componentColor" font-size="15">A</text>
            <text x="162" y="50" :fill="componentColor" font-size="15">B</text>
            <text x="212" y="50" :fill="componentColor" font-size="15">C</text>
            <use id="line101-c-txtTitle" href="#c-txtTitle" x="250" y="37" />
            <text id="line101-c-txt" x="275" y="55" :fill="titleTxtColor">馈线三</text>
            <use id="c-kg-x-17" href="#c-kg-x" x="155" y="51" />
            <use id="c-kg-17" :href="switchShow(17)" data-type="switch" data-num="17" x="158" y="64" />
            <use id="c-kg-title-17" data-type="switch" data-num="17" href="#c-kgTitle" x="168" y="69" />
            <text id="c-kg-txt-17" data-type="switch" data-num="17" x="179" y="84" :fill="titleTxtColor">17</text>
            <rect v-if="viewMode === 2 && form.switch[17]" data-type="switch" data-num="17" x="130" y="63" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line104" x1="160" y1="89" x2="160" y2="121" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line104-banyuan-shang" href="#c-banyuan-shang" x="150" y="119" />
            <use id="c-kg-18" :href="scSwitchShow(18)" x="158" y="121" />
            <use id="c-kg-title-18" data-type="switch" data-num="18" href="#c-sckgTitle" x="175" y="125" />
            <text id="c-kg-txt-18" data-type="switch" data-num="18" x="186" y="140" :fill="titleTxtColor">18</text>
            <line id="line1041" x1="114" y1="101" x2="160" y2="101" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line1042" x1="114" y1="101" x2="114" y2="123" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1042-c-rongduan" href="#c-rongduan" x="111" y="123" />
            <line id="line1043" x1="114" y1="142" x2="114" y2="153" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1043-c-001-title" data-type="pt" data-num="2" href="#c-ptTitle" x="80" y="159" />
            <rect v-if="viewMode === 2 && form.pt[2]" data-type="pt" data-num="2" x="74" y="154" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="line1043-c-001-txt" data-type="pt" data-num="2" x="86" y="174" :fill="titleTxtColor2">2</text>
            <text id="pt2-edit-001-txt" data-type="pt" data-num="2" x="46" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.pt[2]">
                <tspan x="62" :y="147 - index * 18" v-for="(item, index) in form.pt[2].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="pt2-view-001-txt" data-type="pt" data-num="2" x="46" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewPt[2]">
                <tspan x="0" :y="163 + index * 18" v-for="(item, index) in viewForm.viewPt[2].split(',')" :key="index">
                    {{ item }}</tspan>
            </text>
            <use id="line1043-c-001" href="#c-001" x="104" y="153" />
            <line id="line105" x1="160" y1="146" x2="160" y2="160" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="c-kg-title-19" data-type="switch" data-num="19" href="#c-kgTitle" x="168" y="178" />
            <text id="c-kg-txt-19" data-type="switch" data-num="19" x="179" y="193" :fill="titleTxtColor">19</text>
            <rect v-if="viewMode === 2 && form.switch[19]" data-type="switch" data-num="19" x="130" y="173" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <use id="c-kg-x-19" href="#c-kg-x" x="155" y="160" />
            <use id="c-kg-19" :href="switchShow(19)" data-type="switch" data-num="19" x="158" y="173" />
            <line id="line106" x1="160" y1="198" x2="160" y2="225" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="c-kg-18-1" :href="scSwitchShow(18)" x="158" y="225" />
            <line id="line107" x1="160" y1="250" x2="160" y2="275" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line107-banyuan-xia" href="#c-banyuan-xia" x="150" y="255" />
            <line id="line108" x1="160" y1="275" x2="160" y2="317" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line108-c-002-2-title" data-type="ct" data-num="4" href="#c-ctTitle" x="125" y="275" />
            <text id="line108-c-002-2-txt" data-type="ct" data-num="4" x="130" y="290" :fill="titleTxtColor2">4</text>
            <polyline points="160,303 260,303 260,310" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <polyline points="440,303 315,303 315,380 260,380 260,350" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <use id="c-kg-title-31" data-type="switch" data-num="31" href="#c-kgTitle" x="268" y="327" />
            <text id="c-kg-txt-31" data-type="switch" data-num="31" x="280" y="342" :fill="titleTxtColor">31</text>
            <rect v-if="viewMode === 2 && form.switch[31]" data-type="switch" data-num="31" x="230" y="322" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <use id="c-kg-x-31" href="#c-kg-x" x="255" y="310" />
            <use id="c-kg-31" :href="switchShow(31)" data-type="switch" data-num="31" x="258" y="325" />

            <rect v-if="viewMode === 2 && form.ct[4]" data-type="ct" data-num="4" x="119" y="269" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct4-edit-001-txt" data-type="ct" data-num="4" x="119" y="269" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[4]">
                <tspan x="119" :y="262 - index * 18" v-for="(item, index) in form.ct[4].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct4-view-001-txt" data-type="ct" data-num="4" x="119" y="269" :fill="msgTxtColor"
                v-if="viewForm.viewCt[4]">
                <tspan x="186" :y="242 - (4 - viewForm.viewCt[4].split(',').length) * 9 + index * 18"
                    v-for="(item, index) in viewForm.viewCt[4].split(',')" :key="index">{{ item }}</tspan>
            </text>
            <use id="line108-c-002-2" href="#c-002-2" x="150" y="275" />
            <line id="line1081" x1="100" y1="317" x2="201" y2="317" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line1082" x1="100" y1="317" x2="100" y2="336" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1082-c-rongduan" href="#c-rongduan" x="97" y="336" />
            <line id="line10821" x1="100" y1="357" x2="100" y2="366" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1082-c-001-title" data-type="pt" data-num="3" href="#c-ptTitle" x="66" y="370" />
            <text id="line1082-c-001-txt" data-type="pt" data-num="3" x="72" y="384" :fill="titleTxtColor2">3</text>
            <rect v-if="viewMode === 2 && form.pt[3]" data-type="pt" data-num="3" x="60" y="364" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="pt3-edit-001-txt" data-type="pt" data-num="3" x="36" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.pt[3]">
                <tspan x="60" :y="356 - index * 18" v-for="(item, index) in form.pt[3].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="pt3-view-001-txt" data-type="pt" data-num="3" x="36" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewPt[3]">
                <tspan x="0" :y="380 + index * 18" v-for="(item, index) in viewForm.viewPt[3].split(',')" :key="index">
                    {{ item }}</tspan>
            </text>
            <use id="line1082-c-001" href="#c-001" x="90" y="366" />
            <line id="line1083" x1="135" y1="317" x2="135" y2="336" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1083-c-003" href="#c-003" x="127" y="336" />
            <line id="line1084" x1="201" y1="317" x2="201" y2="334" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1084-c-004" href="#c-004" x="193" y="334" />
            <line id="line112" x1="160" y1="317" x2="160" y2="384" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line118" x1="160" y1="384" x2="160" y2="443" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line118-c-002-1-title" data-type="ct" data-num="7" href="#c-ctTitle" x="126" y="402" />
            <text id="line118-c-002-1-txt" data-type="ct" data-num="7" x="132" y="419" :fill="titleTxtColor2">7</text>
            <rect v-if="viewMode === 2 && form.ct[7]" data-type="ct" data-num="7" x="120" y="397" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct7-edit-001-txt" data-type="ct" data-num="7" x="121" y="398" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[7]">
                <tspan x="122" :y="441 + index * 18" v-for="(item, index) in form.ct[7].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct7-view-001-txt" data-type="ct" data-num="7" x="121" y="398" :fill="msgTxtColor"
                v-if="viewForm.viewCt[7]">
                <tspan x="60" :y="417 + index * 18" v-for="(item, index) in viewForm.viewCt[7].split(',')" :key="index">
                    {{ item }}</tspan>
            </text>
            <use id="line118-c-002-1" href="#c-002-1" x="152" y="389" />
            <line id="line1181" x1="77" y1="443" x2="247" y2="443" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line1182" x1="77" y1="443" x2="77" y2="504" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line1182-c-002-2" href="#c-002-2" x="67" y="453" />
            <text x="82" y="493" :fill="componentColor" font-size="14">ZJa</text>
            <use id="c-kg-title-11" data-type="switch" data-num="11" href="#c-kgTitle" x="85" y="522" />
            <text id="c-kg-txt-11" data-type="switch" data-num="11" x="96" y="537" :fill="titleTxtColor">11</text>
            <use id="c-kg-d-11" href="#c-kg-d" x="70" y="504" />
            <use id="c-kg-11" :href="switchShow(11)" data-type="switch" data-num="11" x="75" y="517" />
            <rect v-if="viewMode === 2 && form.switch[11]" data-type="switch" data-num="11" x="48" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line1183" x1="160" y1="443" x2="160" y2="504" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1183-c-002-2" href="#c-002-2" x="150" y="453" />
            <text x="165" y="493" :fill="componentColor" font-size="14">ZJb</text>
            <use id="c-kg-title-10" data-type="switch" data-num="10" href="#c-kgTitle" x="168" y="522" />
            <text id="c-kg-txt-10" data-type="switch" data-num="10" x="179" y="537" :fill="titleTxtColor">10</text>
            <use id="c-kg-d-10" href="#c-kg-d" x="153" y="504" />
            <use id="c-kg-10" :href="switchShow(10)" data-type="switch" data-num="10" x="158" y="517" />
            <rect v-if="viewMode === 2 && form.switch[10]" data-type="switch" data-num="10" x="132" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line1184" x1="247" y1="443" x2="247" y2="504" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line1184-c-002-2" href="#c-002-2" x="237" y="453" />
            <text x="252" y="493" :fill="componentColor" font-size="14">ZJc</text>
            <use id="c-kg-title-9" data-type="switch" data-num="9" href="#c-kgTitle" x="255" y="522" />
            <text id="c-kg-txt-9" data-type="switch" data-num="9" x="266" y="537" :fill="titleTxtColor">9</text>
            <use id="c-kg-d-9" href="#c-kg-d" x="240" y="504" />
            <use id="c-kg-9" :href="switchShow(9)" data-type="switch" data-num="9" x="245" y="517" />
            <rect v-if="viewMode === 2 && form.switch[9]" data-type="switch" data-num="9" x="216" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <!-- 20231013 add -->
            <polyline id="line1231" points="77,543 77,646 160,646 160,543" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <polyline id="line1232" points="77,563 103,563 103,575" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="c-kg-title-33" data-type="switch" data-num="33" href="#c-kgTitle" x="108" y="588" />
            <text id="c-kg-txt-33" data-type="switch" data-num="33" x="119" y="603" :fill="titleTxtColor">33</text>
            <rect v-if="viewMode === 2 && form.switch[33]" data-type="switch" data-num="33" x="79" y="583" width="74"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <use id="c-kg-d-33" href="#c-kg-d" x="96" y="573" />
            <use id="c-kg-33" :href="switchShow(33)" data-type="switch" data-num="33" x="101" y="587" />
            <polyline id="line1233" points="103,612 103,623 152,623 152,563 160,563" fill="transparent"
                :stroke="componentColor" :stroke-width="lineWidth" />
            <polyline id="line1233-R" points="118,619 140,619 140,628 118,628 118,619" fill="transparent"
                :stroke="componentColor" :stroke-width="lineWidth" />
            <text x="130" y="642" :fill="componentColor" font-size="14">R</text>
            <line id="line123" x1="160" y1="543" x2="160" y2="574" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line1232" x1="247" y1="543" x2="247" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line1233" x1="160" y1="574" x2="247" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <!-- 2xx -->
            <line id="line201" x1="440" y1="32" x2="440" y2="59" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line201-c-txtTitle" href="#c-txtTitle" x="450" y="65" />
            <text id="line201-c-txt" x="480" y="84" :fill="titleTxtColor">馈线二</text>
            <line id="line202" x1="440" y1="59" x2="440" y2="119" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line202-banyuan-shang" href="#c-banyuan-shang" x="430" y="116" />
            <use id="c-kg-12" :href="scSwitchShow(12)" x="438" y="119" />
            <use id="c-kg-title-12" data-type="switch" data-num="13" href="#c-sckgTitle" x="458" y="122" />
            <text id="c-kg-txt-12" data-type="switch" data-num="13" x="467" y="137" :fill="titleTxtColor">12</text>

            <rect v-if="viewMode === 2 && form.switch[12]" data-type="switch" data-num="12" x="410" y="117" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line204" x1="440" y1="144" x2="440" y2="159" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="c-kg-title-13" data-type="switch" data-num="13" href="#c-kgTitle" x="448" y="177" />
            <text id="c-kg-txt-13" data-type="switch" data-num="13" x="459" y="192" :fill="titleTxtColor">13</text>
            <use id="c-kg-x-13" href="#c-kg-x" x="435" y="159" />
            <use id="c-kg-13" :href="switchShow(13)" data-type="switch" data-num="13" x="438" y="172" />
            <rect v-if="viewMode === 2 && form.switch[13]" data-type="switch" data-num="13" x="410" y="171" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line205" x1="440" y1="197" x2="440" y2="222" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="c-kg-12-1" :href="scSwitchShow(12)" x="438" y="222" />
            <line id="line206" x1="440" y1="247" x2="440" y2="279" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line206-banyuan-xia" href="#c-banyuan-xia" x="430" y="252" />
            <line id="line207" x1="440" y1="279" x2="440" y2="318" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line207-c-002-2-title" data-type="ct" data-num="3" href="#c-ctTitle" x="404" y="279" />
            <text id="line207-c-002-2-txt" data-type="ct" data-num="3" x="410" y="294" :fill="titleTxtColor2">3</text>
            <rect v-if="viewMode === 2 && form.ct[3]" data-type="ct" data-num="3" x="398" y="273" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct3-edit-001-txt" data-type="ct" data-num="3" x="36" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[3]">
                <tspan x="370" :y="300 - index * 18" v-for="(item, index) in form.ct[3].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct3-view-001-txt" data-type="ct" data-num="3" x="36" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewCt[3]">
                <tspan x="467" :y="314 - index * 18" v-for="(item, index) in viewForm.viewCt[3].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line207-c-002-2" href="#c-002-2" x="430" y="279" />
            <line id="line2071" x1="394" y1="318" x2="394" y2="339" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line2071-c-003" href="#c-003" x="386" y="339" />
            <line id="line2072" x1="440" y1="318" x2="440" y2="386" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line2073" x1="482" y1="318" x2="482" y2="335" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line2073-c-004" href="#c-004" x="474" y="335" />
            <line id="line2074" x1="394" y1="318" x2="482" y2="318" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line208" x1="440" y1="386" x2="440" y2="444" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line208-c-002-1-title" data-type="ct" data-num="6" href="#c-ctTitle" x="402" y="404" />
            <text id="line208-c-002-1-txt" data-type="ct" data-num="6" x="408" y="420" :fill="titleTxtColor2">6</text>
            <rect v-if="viewMode === 2 && form.ct[6]" data-type="ct" data-num="6" x="396" y="398" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct6-edit-001-txt" data-type="ct" data-num="6" x="36" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[6]">
                <tspan x="398" :y="442 + index * 18" v-for="(item, index) in form.ct[6].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct6-view-001-txt" data-type="ct" data-num="6" x="36" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewCt[6]">
                <tspan x="336" :y="417 + index * 18" v-for="(item, index) in viewForm.viewCt[6].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line208-c-002-1" href="#c-002-1" x="432" y="391" />
            <line id="line2081" x1="355" y1="444" x2="525" y2="444" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line2082" x1="355" y1="444" x2="355" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line2082-c-002-2" href="#c-002-2" x="345" y="453" />
            <text x="360" y="493" :fill="componentColor" font-size="14">ZJa</text>
            <use id="c-kg-title-16" data-type="switch" data-num="16" href="#c-kgTitle" x="363" y="523" />
            <text id="c-kg-txt-16" data-type="switch" data-num="16" x="374" y="538" :fill="titleTxtColor">16</text>
            <use id="c-kg-d-16" href="#c-kg-d" x="348" y="505" />
            <use id="c-kg-16" :href="switchShow(16)" data-type="switch" data-num="16" x="353" y="518" />
            <rect v-if="viewMode === 2 && form.switch[16]" data-type="switch" data-num="16" x="326" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line2083" x1="440" y1="444" x2="440" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line2083-c-002-2" href="#c-002-2" x="430" y="453" />
            <text x="445" y="493" :fill="componentColor" font-size="14">ZJb</text>
            <use id="c-kg-title-15" data-type="switch" data-num="15" href="#c-kgTitle" x="448" y="523" />
            <text id="c-kg-txt-15" data-type="switch" data-num="15" x="459" y="538" :fill="titleTxtColor">15</text>
            <use id="c-kg-d-15" href="#c-kg-d" x="433" y="505" />
            <use id="c-kg-15" :href="switchShow(15)" data-type="switch" data-num="15" x="438" y="518" />
            <rect v-if="viewMode === 2 && form.switch[15]" data-type="switch" data-num="15" x="410" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line2084" x1="525" y1="444" x2="525" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line2084-c-002-2" href="#c-002-2" x="515" y="453" />
            <text x="530" y="493" :fill="componentColor" font-size="14">ZJc</text>
            <use id="c-kg-title-14" data-type="switch" data-num="14" href="#c-kgTitle" x="533" y="523" />
            <text id="c-kg-txt-14" data-type="switch" data-num="14" x="544" y="538" :fill="titleTxtColor">14</text>
            <use id="c-kg-d-14" href="#c-kg-d" x="518" y="505" />
            <use id="c-kg-14" :href="switchShow(14)" data-type="switch" data-num="14" x="523" y="518" />
            <rect v-if="viewMode === 2 && form.switch[14]" data-type="switch" data-num="14" x="494" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line210" x1="440" y1="544" x2="440" y2="574" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line2101" x1="355" y1="544" x2="355" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line2102" x1="525" y1="544" x2="525" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line2103" x1="355" y1="574" x2="525" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <!-- 3xx -->
            <line id="line301" x1="703" y1="59" x2="703" y2="114" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line301-c-txtTitle" href="#c-txtTitle" x="713" y="65" />
            <text id="line301-c-txt" x="743" y="84" :fill="titleTxtColor">馈线一</text>
            <use id="c-kg-title-8" data-type="switch" data-num="8" href="#c-kgTitle" x="711" y="132" />
            <text id="c-kg-txt-8" data-type="switch" data-num="8" x="726" y="147" :fill="titleTxtColor">8</text>
            <use id="c-kg-x-8" href="#c-kg-x" x="698" y="114" />
            <use id="c-kg-8" :href="switchShow(8)" data-type="switch" data-num="8" x="701" y="127" />
            <rect v-if="viewMode === 2 && form.switch[8]" data-type="switch" data-num="8" x="675" y="125" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line302" x1="703" y1="152" x2="703" y2="224" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line3021" x1="663" y1="224" x2="663" y2="257" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line3021-c-003" href="#c-003" x="655" y="257" />
            <line id="line3022" x1="703" y1="224" x2="703" y2="384" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line3023" x1="743" y1="224" x2="743" y2="249" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line3023-c-rongduan" href="#c-rongduan" x="740" y="249" />
            <use id="line3023-c-dd" href="#c-dd" x="737" y="269" />
            <use id="line3023-c-jiedi" href="#c-jiedi" x="735" y="280" />
            <line id="line3024" x1="663" y1="224" x2="743" y2="224" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line303" x1="703" y1="384" x2="703" y2="444" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line303-c-002-1-title" data-type="ct" data-num="5" href="#c-ctTitle" x="667" y="400" />
            <text id="line303-c-002-1-txt" data-type="ct" data-num="5" x="673" y="415" :fill="titleTxtColor2">5</text>
            <rect v-if="viewMode === 2 && form.ct[5]" data-type="ct" data-num="5" x="662" y="394" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct5-edit-001-txt" data-type="ct" data-num="5" x="36" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[5]">
                <tspan x="663" :y="438 + index * 18" v-for="(item, index) in form.ct[5].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct5-view-001-txt" data-type="ct" data-num="5" x="36" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewCt[5]">
                <tspan x="602" :y="415 + index * 18" v-for="(item, index) in viewForm.viewCt[5].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line303-c-002-1" href="#c-002-1" x="695" y="389" />
            <line id="line3031" x1="619" y1="444" x2="619" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line3031-c-002-2" href="#c-002-2" x="609" y="453" />
            <text x="624" y="493" :fill="componentColor" font-size="14">ZJa</text>
            <use id="c-kg-title-22" data-type="switch" data-num="22" href="#c-kgTitle" x="627" y="523" />
            <text id="c-kg-txt-22" data-type="switch" data-num="22" x="642" y="538" :fill="titleTxtColor">22</text>
            <use id="c-kg-d-22" href="#c-kg-d" x="612" y="505" />
            <use id="c-kg-22" :href="switchShow(22)" data-type="switch" data-num="22" x="617" y="518" />
            <rect v-if="viewMode === 2 && form.switch[22]" data-type="switch" data-num="22" x="590" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line3032" x1="703" y1="444" x2="703" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line3032-c-002-2" href="#c-002-2" x="693" y="453" />
            <text x="708" y="493" :fill="componentColor" font-size="14">ZJb</text>
            <use id="c-kg-title-21" data-type="switch" data-num="21" href="#c-kgTitle" x="711" y="523" />
            <text id="c-kg-txt-21" data-type="switch" data-num="21" x="722" y="538" :fill="titleTxtColor">21</text>
            <use id="c-kg-d-21" href="#c-kg-d" x="696" y="505" />
            <use id="c-kg-21" :href="switchShow(21)" data-type="switch" data-num="21" x="701" y="518" />
            <rect v-if="viewMode === 2 && form.switch[21]" data-type="switch" data-num="21" x="674" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line3033" x1="788" y1="444" x2="788" y2="505" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line3033-c-002-2" href="#c-002-2" x="778" y="453" />
            <text x="793" y="493" :fill="componentColor" font-size="14">ZJc</text>
            <use id="c-kg-title-20" data-type="switch" data-num="20" href="#c-kgTitle" x="796" y="523" />
            <text id="c-kg-txt-20" data-type="switch" data-num="20" x="807" y="538" :fill="titleTxtColor">20</text>
            <use id="c-kg-d-20" href="#c-kg-d" x="781" y="505" />
            <use id="c-kg-20" :href="switchShow(20)" data-type="switch" data-num="20" x="786" y="518" />
            <rect v-if="viewMode === 2 && form.switch[20]" data-type="switch" data-num="20" x="758" y="516" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line3034" x1="619" y1="444" x2="788" y2="444" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line304" x1="703" y1="544" x2="703" y2="574" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line3041" x1="619" y1="544" x2="619" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line3042" x1="788" y1="544" x2="788" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line3043" x1="618" y1="574" x2="788" y2="574" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <!-- 4xx -->
            <line id="line401" x1="950" y1="59" x2="950" y2="112" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line401-c-txtTitle" href="#c-txtTitle" x="960" y="65" />
            <text id="line401-c-txt" x="975" y="84" :fill="titleTxtColor">故障处理柜</text>
            <use id="c-kg-title-4" data-type="switch" data-num="4" href="#c-kgTitle" x="958" y="125" />
            <text id="c-kg-txt-4" data-type="switch" data-num="4" x="972" y="140" :fill="titleTxtColor">4</text>
            <use id="c-kg-dh-4" href="#c-dh" x="940" y="112" />
            <use id="c-kg-4" :href="switchShow(4)" data-type="switch" data-num="4" x="948" y="120" />
            <rect v-if="viewMode === 2 && form.switch[4]" data-type="switch" data-num="4" x="920" y="118" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line402" x1="950" y1="145" x2="950" y2="193" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line402-c-rongduan" href="#c-rongduan" x="947" y="193" />
            <text x="957" y="208" :fill="componentColor" font-size="10">FU</text>
            <line id="line4021" x1="907" y1="163" x2="987" y2="163" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line4022" x1="907" y1="163" x2="907" y2="177" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="915" y="194" :fill="componentColor" font-size="10">HDB</text>
            <use id="line4022-c-003" href="#c-003" x="899" y="177" />
            <line id="line4023" x1="987" y1="163" x2="987" y2="177" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="1000" y="208" :fill="componentColor" font-size="10">CGQ</text>
            <use id="line4023-c-004" href="#c-004" x="979" y="177" />
            <line id="line406" x1="950" y1="213" x2="950" y2="283" :stroke="componentColor" :stroke-width="lineWidth" />
            <text x="956" y="263" :fill="componentColor" font-size="14">ZJb</text>
            <use id="c-kg-title-6" data-type="switch" data-num="6" href="#c-kgTitle" x="958" y="301" />
            <text id="c-kg-txt-6" data-type="switch" data-num="6" x="972" y="316" :fill="titleTxtColor">6</text>
            <use id="c-kg-d-6" href="#c-kg-d" x="943" y="283" />
            <use id="c-kg-6" :href="switchShow(6)" data-type="switch" data-num="6" x="948" y="296" />
            <rect v-if="viewMode === 2 && form.switch[6]" data-type="switch" data-num="6" x="920" y="294" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line4061" x1="867" y1="276" x2="867" y2="283" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="870" y="263" :fill="componentColor" font-size="14">ZJa</text>
            <use id="c-kg-title-5" data-type="switch" data-num="5" href="#c-kgTitle" x="875" y="301" />
            <text id="c-kg-txt-5" data-type="switch" data-num="5" x="889" y="316" :fill="titleTxtColor">5</text>
            <use id="c-kg-d-5" href="#c-kg-d" x="860" y="283" />
            <use id="c-kg-5" :href="switchShow(5)" data-type="switch" data-num="5" x="865" y="296" />
            <rect v-if="viewMode === 2 && form.switch[5]" data-type="switch" data-num="5" x="837" y="294" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line4062" x1="1037" y1="276" x2="1037" y2="283" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="1040" y="263" :fill="componentColor" font-size="14">ZJc</text>
            <use id="c-kg-title-7" data-type="switch" data-num="7" href="#c-kgTitle" x="1045" y="301" />
            <text id="c-kg-txt-7" data-type="switch" data-num="7" x="1059" y="316" :fill="titleTxtColor">7</text>
            <use id="c-kg-d-7" href="#c-kg-d" x="1030" y="283" />
            <use id="c-kg-7" :href="switchShow(7)" data-type="switch" data-num="7" x="1035" y="296" />
            <rect v-if="viewMode === 2 && form.switch[7]" data-type="switch" data-num="7" x="1007" y="294" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line403" x1="950" y1="321" x2="950" y2="376" :stroke="componentColor" :stroke-width="lineWidth" />
            <text x="955" y="380" :fill="componentColor" font-size="14">ZJn</text>
            <use id="c-kg-title-27" data-type="switch" data-num="27" href="#c-kgTitle" x="957" y="392" />
            <text id="c-kg-txt-27" data-type="switch" data-num="27" x="968" y="408" :fill="titleTxtColor">27</text>
            <use id="c-kg-d-27" href="#c-kg-d" x="943" y="376" />
            <use id="c-kg-27" :href="switchShow(27)" data-type="switch" data-num="27" x="948" y="389" />
            <rect v-if="viewMode === 2 && form.switch[27]" data-type="switch" data-num="27" x="920" y="387" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line4032" x1="867" y1="321" x2="867" y2="353" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line4033" x1="1037" y1="321" x2="1037" y2="353" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line4031" x1="866" y1="353" x2="1037" y2="353" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line4034" x1="891" y1="367" x2="949" y2="367" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line4035" x1="891" y1="367" x2="891" y2="400" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="878" y="414" :fill="componentColor" font-size="10">R</text>
            <use id="line4035-c-dianzu" href="#c-dianzu" x="888" y="400" />
            <line id="line4036" x1="891" y1="420" x2="891" y2="467" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line404" x1="950" y1="415" x2="950" y2="467" :stroke="componentColor" :stroke-width="lineWidth" />
            <use id="line404-c-002-2-title" data-type="ct" data-num="2" href="#c-ctTitle" x="914" y="424" />
            <text id="line404-c-002-2-txt" data-type="ct" data-num="2" x="920" y="439" :fill="titleTxtColor2">2</text>
            <rect v-if="viewMode === 2 && form.ct[2]" data-type="ct" data-num="2" x="908" y="418" width="32" height="32"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct2-edit-001-txt" data-type="ct" data-num="2" x="906" y="486" fill="#ffee05"
                v-if="viewMode === 2 && form.ct[2]">
                <tspan x="906" :y="416 - index * 18" v-for="(item, index) in form.ct[2].split(',')" :key="index">{{ item
                    }}</tspan>
            </text>
            <text id="ct2-view-001-txt" data-type="ct" data-num="2" x="36" y="173" fill="#ffee05"
                v-if="viewForm.viewCt[2]">
                <tspan x="906" :y="485 + index * 18" v-for="(item, index) in viewForm.viewCt[2].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line404-c-002-2" href="#c-002-2" x="940" y="424" />
            <text x="957" y="458" :fill="componentColor" font-size="10">LH</text>
            <line id="line4051" x1="891" y1="467" x2="1094" y2="467" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line4051-c-jiedi" href="#c-jiedi" x="1016" y="467" />
            <!-- 5xx -->
            <line id="line501" x1="1264" y1="59" x2="1264" y2="112" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line501-c-txtTitle" href="#c-txtTitle" x="1274" y="65" />
            <text id="line501-c-txt" x="1289" y="84" :fill="titleTxtColor">脉冲选线柜</text>
            <use id="c-kg-title-3" data-type="switch" data-num="3" href="#c-kgTitle" x="1272" y="125" />
            <text id="c-kg-txt-3" data-type="switch" data-num="3" x="1285" y="140" :fill="titleTxtColor">3</text>
            <use id="c-kg-dh-3" href="#c-dh" x="1254" y="112" />
            <use id="c-kg-3" :href="switchShow(3)" data-type="switch" data-num="3" x="1262" y="120" />
            <rect v-if="viewMode === 2 && form.switch[3]" data-type="switch" data-num="3" x="1234" y="118" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text x="1272" y="124" :fill="componentColor" font-size="10">GN</text>
            <line id="line502" x1="1264" y1="146" x2="1264" y2="181" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line5021" x1="1174" y1="181" x2="1367" y2="181" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line5022" x1="1174" y1="181" x2="1174" y2="224" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5022-c-004" href="#c-004" x="1166" y="224" />
            <text x="1184" y="253" :fill="componentColor" font-size="10">CGQ</text>
            <line id="line5023" x1="1236" y1="181" x2="1236" y2="204" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5023-c-006" href="#c-006" x="1218" y="204" />
            <line id="line5024" x1="1297" y1="181" x2="1297" y2="212" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5024-c-rongduan" href="#c-rongduan" x="1294" y="212" />
            <text x="1304" y="226" :fill="componentColor" font-size="10">RD</text>
            <line id="line50241" x1="1297" y1="233" x2="1297" y2="270" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5024-c-001-title" data-type="pt" data-num="1" href="#c-ptTitle" x="1258" y="270" />
            <text id="line5024-c-001-txt" data-type="pt" data-num="1" x="1264" y="285" :fill="titleTxtColor2">1</text>
            <rect v-if="viewMode === 2 && form.pt[1]" data-type="pt" data-num="1" x="1252" y="264" width="32"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="pt1-edit-001-txt" data-type="pt" data-num="1" x="1248" y="256" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.pt[1]">
                {{ form.pt[1] }}
            </text>
            <text id="pt1-view-001-txt" data-type="pt" data-num="1" x="1264" y="315" :fill="msgTxtColor"
                v-if="viewForm.viewPt[1]">
                <tspan x="1258" :y="340 + index * 18" v-for="(item, index) in viewForm.viewPt[1].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line5024-c-010" href="#c-010" x="1273" y="270" />
            <line id="line5025" x1="1368" y1="181" x2="1368" y2="273" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5025-c-011" href="#c-011" x="1361" y="273" />
            <line id="line50251" x1="1368" y1="295" x2="1368" y2="323" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5025-c-jiedi" href="#c-jiedi" x="1360" y="323" />
            <line id="line503" x1="1236" y1="222" x2="1236" y2="388" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line503-c-kkgTitle" href="#c-kkgTitle" x="1184" y="388" />
            <text id="line503-kkgTitle" x="1194" y="405" :fill="titleTxtColor">1</text>
            <use id="line503-c-009" href="#c-009" x="1213" y="388" />
            <line id="line5031" x1="1094" y1="367" x2="1236" y2="367" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line5032" x1="1094" y1="367" x2="1094" y2="414" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5032-c-008" href="#c-008" x="1082" y="412" />
            <line id="line5033" x1="1094" y1="434" x2="1094" y2="467" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line5033-c-002-2-title" data-type="ct" data-num="1" href="#c-ctTitle" x="1059" y="440" />
            <text id="line5033-c-002-2-txt" data-type="ct" data-num="1" x="1064" y="455" :fill="titleTxtColor2">1</text>
            <rect v-if="viewMode === 2 && form.ct[1]" data-type="ct" data-num="1" x="1052" y="434" width="32"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <text id="ct1-edit-001-txt" data-type="ct" data-num="1" x="36" y="173" :fill="msgTxtColor"
                v-if="viewMode === 2 && form.ct[1]">
                <tspan x="1025" :y="460 - index * 18" v-for="(item, index) in form.ct[1].split(',')" :key="index">{{
                    item }}</tspan>
            </text>
            <text id="ct1-view-001-txt" data-type="ct" data-num="1" x="36" y="173" :fill="msgTxtColor"
                v-if="viewForm.viewCt[1]">
                <tspan x="1050" :y="485 + index * 18" v-for="(item, index) in viewForm.viewCt[1].split(',')"
                    :key="index">{{ item }}</tspan>
            </text>
            <use id="line5033-c-002-2" href="#c-002-2" x="1084" y="440" />
            <line id="line504" x1="1236" y1="408" x2="1236" y2="550" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="line504-c-jiedi" href="#c-jiedi" x="1228" y="550" />
            <!-- 6xx 最左边的线路 -->
            <line id="line601-1" x1="1445" y1="59" x2="1445" y2="510" :stroke="componentColor"
                :stroke-width="masterLineWidth" />
            <use id="line603-c-012" href="#c-012" x="1413" y="616" />
            <polyline points="1445,275 1434,295 1456,295 1445,275" fill="transparent" :stroke="componentColor"
                :stroke-width="masterLineWidth" />
            <polyline id="line603-2" points="1445,500 1355,500 1355,534" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <!-- 画圆参数：M为圆边线的起始点；L为圆心坐标 A参数依次为半径1、、、1顺时针0逆时针、最后2个参数为结束点坐标-->
            <path d="M 1445 570 A 30 30 0 1 1 1475 540" :stroke="componentColor" :stroke-width="lineWidth"
                fill="transparent" />
            <line id="line601-2" x1="1445" y1="540" x2="1475" y2="540" :stroke="componentColor"
                :stroke-width="masterLineWidth" />
            <line id="line601-3" x1="1445" y1="570" x2="1445" y2="616" :stroke="componentColor"
                :stroke-width="masterLineWidth" />
            <use id="c-kg-title-34" data-type="switch" data-num="34" href="#c-kgTitle" x="1360" y="552" />
            <text id="c-kg-txt-34" data-type="switch" data-num="34" x="1371" y="567" :fill="titleTxtColor">34</text>
            <rect v-if="viewMode === 2 && form.switch[34]" data-type="switch" data-num="34" x="1329" y="547" width="80"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <use id="c-kg-x-34" href="#c-kg-x" x="1350" y="534" />
            <use id="c-kg-34" :href="switchShow(34)" data-type="switch" data-num="34" x="1353" y="549" />

            <use id="line603-c-002-2" href="#c-002-2" x="1345" y="585" />
            <use id="c-kg-title-9" data-type="ct" data-num="9" href="#c-ctTitle" x="1385" y="586" />
            <text id="c-kg-txt-9" data-type="ct" data-num="9" x="1392" y="601" :fill="titleTxtColor2">9</text>
            <use id="line603-c-txtTitle" href="#c-txtTitle" x="1240" y="584" />
            <text x="1248" y="602" :fill="titleTxtColor" font-size="14">深度限流装置</text>
            <polyline id="line603-3" points="1445,615 1355,615 1355,575" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <use id="line603-c-002-2" href="#c-002-2" x="1435" y="630" />
            <use id="c-kg-title-8" data-type="ct" data-num="8" href="#c-ctTitle" x="1475" y="630" />
            <text id="c-kg-txt-8" data-type="ct" data-num="8" x="1481" y="645" :fill="titleTxtColor2">8</text>

            <line id="line603" x1="1445" y1="746" x2="1445" y2="760" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <use id="c-kg-title-1" data-type="switch" data-num="1" href="#c-kgTitle" x="1453" y="769" />
            <text id="c-kg-txt-1" data-type="switch" data-num="1" x="1469" y="785" :fill="titleTxtColor">1</text>
            <use id="c-kg-1" :href="switchShow(1)" data-type="switch" data-num="1" x="1443" y="764" />
            <rect v-if="viewMode === 2 && form.switch[1]" data-type="switch" data-num="1" x="1415" y="762" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line605" x1="1445" y1="789" x2="1445" y2="840" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <!-- 下方的电路 7xx -->
            <line id="line701" x1="440" y1="574" x2="440" y2="592" :stroke="componentColor" :stroke-width="lineWidth" />

            <use id="c-kg-title-2" data-type="switch" data-num="2" href="#c-kgTitle" x="450" y="608" />
            <text id="c-kg-txt-2" data-type="switch" data-num="2" x="466" y="623" :fill="titleTxtColor">2</text>
            <use id="c-kg-d-2" href="#c-kg-d" x="433" y="592" />
            <use id="c-kg-2" :href="switchShow(2)" data-type="switch" data-num="2" x="438" y="605" />
            <rect v-if="viewMode === 2 && form.switch[2]" data-type="switch" data-num="2" x="420" y="602" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <use id="line701-c-kkgTitle" data-type="device" data-num="2" href="#c-kkgTitle" x="508" y="606" />
            <text id="line701-kkgTitle" data-type="device" data-num="2" x="519" y="623" :fill="titleTxtColor">2</text>
            <line id="line7011" x1="505" y1="605" x2="495" y2="634" :stroke="kgBgColor" :stroke-width="3" />
            <!-- use id="line701-c-005" data-type="device" data-num="2" href="#c-005" x="402" y="592" /-->
            <text v-if="deviceType" data-type="device" data-num="2" x="480" y="606" :fill="msgTxtColor"
                font-size="14">{{ deviceType }}</text>
            <rect v-if="deviceType" data-type="device" data-num="2" x="384" y="586" width="84" height="56"
                stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line702" x1="440" y1="630" x2="440" y2="652" :stroke="componentColor" :stroke-width="lineWidth" />
            <line id="line7021" x1="274" y1="652" x2="526" y2="652" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line7022" x1="274" y1="652" x2="274" y2="712" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="285" y="692" :fill="componentColor" font-size="14">ZJj</text>
            <use id="c-kg-title-23" data-type="switch" data-num="23" href="#c-kgTitle" x="282" y="730" />
            <text id="c-kg-txt-23" data-type="switch" data-num="23" x="293" y="745" :fill="titleTxtColor">23</text>
            <use id="c-kg-d-23" href="#c-kg-d" x="267" y="712" />
            <use id="c-kg-23" :href="switchShow(23)" data-type="switch" data-num="23" x="272" y="725" />
            <rect v-if="viewMode === 2 && form.switch[23]" data-type="switch" data-num="23" x="243" y="723" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line7023" x1="355" y1="652" x2="355" y2="712" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="366" y="692" :fill="componentColor" font-size="14">ZJh</text>
            <use id="c-kg-title-24" data-type="switch" data-num="24" href="#c-kgTitle" x="363" y="730" />
            <text id="c-kg-txt-24" data-type="switch" data-num="24" x="374" y="745" :fill="titleTxtColor">24</text>
            <use id="c-kg-d-24" href="#c-kg-d" x="348" y="712" />
            <use id="c-kg-24" :href="switchShow(24)" data-type="switch" data-num="24" x="353" y="725" />
            <rect v-if="viewMode === 2 && form.switch[24]" data-type="switch" data-num="24" x="325" y="723" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line7024" x1="440" y1="652" x2="440" y2="712" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="451" y="692" :fill="componentColor" font-size="14">ZJd</text>
            <use id="c-kg-title-25" data-type="switch" data-num="25" href="#c-kgTitle" x="448" y="730" />
            <text id="c-kg-txt-25" data-type="switch" data-num="25" x="459" y="745" :fill="titleTxtColor">25</text>
            <use id="c-kg-d-25" href="#c-kg-d" x="433" y="712" />
            <use id="c-kg-25" :href="switchShow(25)" data-type="switch" data-num="25" x="438" y="725" />
            <rect v-if="viewMode === 2 && form.switch[25]" data-type="switch" data-num="25" x="410" y="723" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line7025" x1="526" y1="652" x2="526" y2="712" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text x="537" y="692" :fill="componentColor" font-size="14">ZJg</text>
            <use id="c-kg-title-26" data-type="switch" data-num="26" href="#c-kgTitle" x="534" y="730" />
            <text id="c-kg-txt-26" data-type="switch" data-num="26" x="545" y="745" :fill="titleTxtColor">26</text>
            <use id="c-kg-d-26" href="#c-kg-d" x="519" y="712" />
            <use id="c-kg-26" :href="switchShow(26)" data-type="switch" data-num="26" x="524" y="725" />
            <rect v-if="viewMode === 2 && form.switch[26]" data-type="switch" data-num="26" x="496" y="723" width="84"
                height="32" stroke="#ffee05" fill="rgba(0, 0, 0, 0)" />
            <line id="line7032" x1="274" y1="751" x2="274" y2="830" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text id="line7032-title" x="288" y="755" writing-mode="tb" :fill="componentColor" font-size="10">
                金属性接地
            </text>
            <line id="line7032" x1="274" y1="830" x2="526" y2="830" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line7033" x1="355" y1="751" x2="355" y2="769" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text id="line7033-title" x="369" y="755" writing-mode="tb" :fill="componentColor" font-size="10">
                间隙性接地
            </text>
            <use id="line7033-007" href="#c-007" x="350" y="769" />
            <line id="line70331" x1="355" y1="791" x2="355" y2="830" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line7034" x1="440" y1="751" x2="440" y2="769" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text id="line7033-title" x="454" y="755" writing-mode="tb" :fill="componentColor" font-size="10">
                低电阻接地
            </text>
            <use id="line7034-dianzu" href="#c-dianzu" x="437" y="769" />
            <line id="line70341" x1="440" y1="788" x2="440" y2="830" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <line id="line7035" x1="526" y1="751" x2="526" y2="769" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <text id="line7033-title" x="540" y="755" writing-mode="tb" :fill="componentColor" font-size="10">
                高电阻接地
            </text>
            <use id="line7035-dianzu" href="#c-dianzu" x="523" y="769" />
            <line id="line70351" x1="526" y1="788" x2="526" y2="830" :stroke="componentColor"
                :stroke-width="lineWidth" />
            <polyline points="400,830 400,840 888,840 888,540 1236,540" fill="transparent" :stroke="componentColor"
                :stroke-width="lineWidth" />

            <!-- 图例牌及其它 8xx -->
            <g id="c-8xx">
                <rect x="40" y="670" rx="4" ry="4" width="205" height="150" fill="transparent" :stroke="kgBgColor"
                    :stroke-width="masterLineWidth" />
                <text x="102" y="695" :fill="kgBgColor" font-size="16">图</text>
                <text x="152" y="695" :fill="kgBgColor" font-size="16">例</text>
                <line x1="66" y1="704" x2="220" y2="704" :stroke="kgBgColor" :stroke-width="masterLineWidth" />

                <use href="#c-kgTitle" x="55" y="718" />
                <text x="67" y="734" :fill="titleTxtColor">XX</text>
                <text x="98" y="734" :fill="msgTxtColor">开关/断路器</text>

                <use href="#c-kkgTitle" x="58" y="746" />
                <text x="67" y="764" :fill="titleTxtColor">X</text>
                <text x="98" y="764" :fill="msgTxtColor">可控硅</text>

                <use href="#c-sckgTitle" x="152" y="746" />
                <text x="167" y="763" :fill="titleTxtColor2">X</text>
                <text x="194" y="763" :fill="msgTxtColor">手车</text>

                <use href="#c-ptTitle" x="62" y="778" />
                <text x="67" y="794" :fill="titleTxtColor">X</text>
                <text x="98" y="794" :fill="msgTxtColor">PT</text>

                <use href="#c-ctTitle" x="152" y="778" />
                <text x="157" y="794" :fill="titleTxtColor2">X</text>
                <text x="178" y="794" :fill="msgTxtColor">CT</text>
            </g>
            <g>
                <polyline :points="elecFlowAnimationData[0][elecFlowCurrentIndexA]" fill="none" class="g-rect-path"
                stroke="#007084" />
                <polyline :points="elecFlowAnimationData[0][elecFlowCurrentIndexA]" fill="none" class="g-rect-path"
                    stroke="#007084" />
                <polyline :points="elecFlowAnimationData[0][elecFlowCurrentIndexA]" fill="none" class="g-rect-fill"
                    stroke="#00e9f9" />
                <polyline :points="elecFlowAnimationData[1][elecFlowCurrentIndexB]" fill="none" class="g-rect-path"
                    stroke="#007084" />
                <polyline :points="elecFlowAnimationData[1][elecFlowCurrentIndexB]" fill="none" class="g-rect-fill"
                    stroke="#00e9f9" />
                <polyline :points="elecFlowAnimationData[2][elecFlowCurrentIndexC]" fill="none" class="g-rect-path"
                    stroke="#007084" />
                <polyline :points="elecFlowAnimationData[2][elecFlowCurrentIndexC]" fill="none" class="g-rect-fill"
                    stroke="#00e9f9" />
            </g>
               <!-- 附加电容 9xx -->
               <!-- <g id="c-9xx">
                <line id="line901" x1="966" y1="599" x2="1346" y2="599" :stroke="componentColor" :stroke-width="masterLineWidth" />

                <line id="line9011" x1="992" y1="599" x2="992" y2="742" :stroke="componentColor" :stroke-width="lineWidth" />
                <g id="c-9011x">
                    <line x1="977" y1="606" x2="977" y2="637" :stroke="componentColor" :stroke-width="lineWidth" />
                    <use id="line9011-c-002-2" href="#c-ss002-2" x="972" y="609" />
                    <use id="line9011-c-002-2" href="#c-ss002-2" x="972" y="624" />
                    <line x1="999" y1="606" x2="999" y2="637" :stroke="componentColor" :stroke-width="lineWidth" />
                    <use id="line9011-c-002-2" href="#c-ss002-2" x="994" y="609" />
                    <use id="line9011-c-002-2" href="#c-ss002-2" x="994" y="624" />
                </g>
                <polyline points="992,656 979,656 979,662" fill="transparent" :stroke="componentColor" :stroke-width="lineWidth" />
                <text x="967" y="670" :fill="componentColor" font-size="4">GQ</text>
                <use href="#c-ss004" x="975" y="660" />
                <polygon points="989,690 995,690 992,694" fill="transparent" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9012" x1="1043" y1="599" x2="1043" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9013" x1="1103" y1="599" x2="1103" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9014" x1="1167" y1="599" x2="1167" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9015" x1="1224" y1="599" x2="1224" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9016" x1="1287" y1="599" x2="1287" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line9017" x1="1338" y1="599" x2="1338" y2="620" :stroke="componentColor" :stroke-width="lineWidth" />
                <use id="c-kg-x-32" href="#c-sskg-x" x="1040" y="617" />
                <use id="c-kg-32" href="#c-sskg" x="1042" y="625" />
                <use id="c-kg-x-33" href="#c-sskg-x" x="1100" y="617" />
                <use id="c-kg-33" href="#c-sskg" x="1102" y="625" />
                <use id="c-kg-x-34" href="#c-sskg-x" x="1164" y="617" />
                <use id="c-kg-34" href="#c-sskg" x="1166" y="625" />
                <use id="c-kg-x-35" href="#c-sskg-x" x="1221" y="617" />
                <use id="c-kg-35" href="#c-sskg" x="1223" y="625" />
                <use id="c-kg-x-36" href="#c-sskg-x" x="1284" y="617" />
                <use id="c-kg-36" href="#c-sskg" x="1286" y="625" />
                <use id="c-kg-x-37" href="#c-sskg-x" x="1335" y="617" />
                <use id="c-kg-37" href="#c-sskg" x="1337" y="625" />
                <use href="#c-dr3k" x="1043" y="640" />
                <use href="#c-dr3k" x="1103" y="640" />
                <use href="#c-dr3k" x="1167" y="640" />
                <use href="#c-dr3k" x="1224" y="640" />
                <use href="#c-dr3k" x="1287" y="640" />
                <polyline points="1380,599 1380,725 1338,725 1338,640" fill="transparent" :stroke="componentColor" :stroke-width="lineWidth" />
                <polygon points="1335,690 1341,690 1338,686" fill="transparent" :stroke="componentColor" :stroke-width="lineWidth" />
                <line id="line908" x1="1374" y1="599" x2="1445" y2="599" :stroke="componentColor" :stroke-width="masterLineWidth" />
            </g> -->
        </svg>
        <div class="test-config" v-if="viewMode === 2 && testConfigData.length">
            <div class="title">测试配置项</div>
            <div class="config-item" v-for="(item, index) in testConfigData" :key="index">{{ item }}</div>
            <div class="title"><el-button type="success" class="prepare" @click="saveTestPlan()">保存为新方案</el-button>
            </div>
        </div>
        <ul v-show="menuVisible" :style="{ left: menuLeft + 'px', top: menuTop + 'px' }" class="contextmenu">
            <!-- 开关/CT/PT 的右键菜单 -->
            <div v-if="menuList.length">
                <div class="menu-title">{{ menuTitle }} 参数设定</div>
                <li v-for="(item, index) in menuList" :key="index" @click.stop="menuSelect($event, item)">
                    <el-checkbox v-model="item.checked">{{ item.label }}</el-checkbox>
                </li>
            </div>
            <!-- 可控硅右键菜单 -->
            <div v-if="selectList.length">
                <div class="menu-title">{{ selectTitle }}</div>
                <div class="select-content">
                    <div class="label">设备类型：</div>
                    <el-select v-model="deviceType" placeholder="请选择">
                        <el-option v-for="item in selectList" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
            </div>
        </ul>
    </div>
</template>

<script setup>
import { ref, watch, computed, onMounted, onBeforeUnmount } from 'vue';
import { useRoute, useRouter } from 'vue-router';

const route = useRoute();
const router = useRouter();

// 定义响应式数据
const now = ref(0);
const menuTitle = ref('');
const menuList = ref([]);
const menuVisible = ref(false);
const selectTitle = ref('');
const selectList = ref([]);
const deviceType = ref('');
const menuTop = ref('');
const menuLeft = ref('');
const linkStatus = ref(0);
const stationId = ref('');
const entId = ref('');
const testConfigData = ref([]);
const viewForm = ref({
    viewPt: {},
    viewCt: {},
    switchList: {}
});
const form = ref({
    pt: {
        1: '',
        2: '',
        3: ''
    },
    ct: {
        1: '',
        2: '',
        3: '',
        4: '',
        5: '',
        6: '',
        7: ''
    },
    switch: {
        1: '',
        2: '',
        3: '',
        4: '',
        5: '',
        6: '',
        7: '',
        8: '',
        9: '',
        10: '',
        11: '',
        12: '',
        13: '',
        14: '',
        15: '',
        16: '',
        17: '',
        18: '',
        19: '',
        20: '',
        21: '',
        22: '',
        23: '',
        24: '',
        25: '',
        26: '',
        27: '',
        31: '',
        32: '',
        33: '',
        34: ''
    }
});
const switchExclusiveList1 = [9, 10, 11, 14, 15, 16, 20, 21, 22];
const switchExclusiveList2 = [23, 24, 25, 26];
const elecFlowTimer = ref(null);
const elecFlowCurrentIndexA = ref(1);
const elecFlowCurrentIndexB = ref(0);
const elecFlowCurrentIndexC = ref(0);
const elecFlowAnimationData = ref([
    ['', '1445,840 1445,59 1264,59 1264,181 1236,181 1236,560'],
    [
        '',
        '1264,59 440,59 440,32 160,32 160,444 247,444 247,574 440,574',
        '1264,59 440,59 440,303 315,303 315,379 260,379 260,315 260,303 160,303 160,444 247,444 247,574 440,574',
        '1264,59 440,59 440,32 160,32 160,574 440,574',
        '1264,59 440,59 440,303 315,303 315,379 260,379 260,315 260,303 160,303 160,574 440,574',
        '1264,59 440,59 440,32 160,32 160,444 77,444 77,574 440,574',
        '1264,59 440,59 440,303 315,303 315,379 260,379 260,315 260,303 160,303 160,444 77,444 77,574 440,574',
        '1264,59 440,59 440,444 525,444 525,574 440,574',
        '1264,59 440,59 440,32 160,32 160,303 260,303 260,379 315,379 315,303 440,303 440,444 525,444 525,574 440,574',
        '1264,59 440,59 440,574',
        '1264,59 440,59 440,32 160,32 160,303 260,303 260,379 315,379 315,303 440,303 440,574',
        '1264,59 440,59 440,444 355,444 355,574 440,574',
        '1264,59 440,59 440,32 160,32 160,303 260,303 260,379 315,379 315,303 440,303 440,444 355,444 355,574 440,574',
        '1264,59 703,59 703,574 440,574',
        '1264,59 703,59 703,574 440,574'
    ],
    [
        '',
        '440,574 440,651 274,651 274,830 400,830 400,840 888,840 888,540 1236,540',
        '440,574 440,651 355,651 355,830 400,830 400,840 888,840 888,540 1236,540',
        '440,574 440,830 400,830 400,840 888,840 888,540 1236,540',
        '440,574 440,651 526,651 526,830 440,830 400,830 400,840 888,840 888,540 1236,540'
    ]
]);

// 定义props
const props = defineProps({
    viewMode: {
        type: Number,
        default: () => 1
    },
    componentColor: {
        type: String,
        default: () => '#007eff'
    },
    lineWidth: {
        type: [String, Number],
        default: 1
    },
    masterLineWidth: {
        type: [String, Number],
        default: 2
    },
    titleTxtColor: {
        type: String,
        default: () => 'white'
    },
    titleTxtColor2: {
        type: String,
        default: () => 'black'
    },
    msgTxtColor: {
        type: String,
        default: () => '#00CC33'
    },
    ctBgColor: {
        type: String,
        default: () => '#FFEE05'
    },
    kgBgColor: {
        type: String,
        default: () => '#2D52A2'
    },
    titleBgColor: {
        type: String,
        default: () => '#24A936'
    },
    bgColor: {
        type: String,
        default: () => '#212120'
    },
    value: {
        type: [String, Number],
        default: 0
    },
    width: {
        type: [String, Number],
        default: 800
    },
    height: {
        type: [String, Number],
        default: 600
    },
    size: {
        type: [String, Number],
        default: 920
    },
    strokeWidth: {
        type: [String, Number],
        default: 10
    },
    color: {
        type: String,
        default: 'rgba(153,202,251,1)'
    },
    duration: {
        type: [String, Number],
        default: 1000
    }
});

// 定义计算属性
const percentage = computed(() => props.value);
const countDown = computed(() => now.value);
const cx = computed(() => props.size / 2);
const cy = computed(() => props.size / 2);
const radius = computed(() => (props.size - props.strokeWidth) / 2);
const circumference = computed(() => 2 * Math.PI * radius.value);
const progress = computed(() => (1 - now.value / 100) * circumference.value);

// 定义方法
const run = () => {
    if (props.value === 0) return;
    let t = props.duration / props.value;
    const timer = setInterval(() => {
        if (now.value >= props.value) {
            clearInterval(timer);
        }
        now.value++;
    }, t);
};

const showMenu = (e) => {
    let { type, num } = e.target.dataset;
    if (!type || props.viewMode === 1) {
        return;
    }
    if (type === 'pt') {
        menuTitle.value = 'PT' + num;
        let listData = form.value.pt[num];
        let beChecklistString = listData;
        if (typeof listData === 'string') {
            beChecklistString = listData.replace('UAB', 'XAB').replace('UAC', 'XAC').replace('UBC', 'XBC');
        }
        menuList.value = [
            {
                label: 'UA',
                checked: /UA/.test(beChecklistString),
                type,
                num
            },
            {
                label: 'UB',
                checked: /UB/.test(beChecklistString),
                type,
                num
            },
            {
                label: 'UC',
                checked: /UC/.test(beChecklistString),
                type,
                num
            },
            {
                label: 'UAB',
                checked: /UAB/.test(beChecklistString),
                type,
                num
            },
            {
                label: 'UAC',
                checked: /UAC/.test(beChecklistString),
                type,
                num
            },
            {
                label: 'UBC',
                checked: /UBC/.test(beChecklistString),
                type,
                num
            },
            {
                label: '3U0',
                checked: /3U0/.test(beChecklistString),
                type,
                num
            }
        ];
    }
    if (type === 'ct') {
        menuTitle.value = 'CT' + num;
        let listData = form.value.ct[num];
        if (num === '5' || num === '6' || num === '7') {
            menuList.value = [
                {
                    label: '3I0',
                    checked: /3I0/.test(listData),
                    type,
                    num
                }
            ];
        } else {
            let beCheckString = listData;
            if (typeof listData === 'string') {
                beCheckString = listData.replace('IAB', 'XAB').replace('IAC', 'XAC').replace('IBC', 'XBC');
            }
            menuList.value = [
                {
                    label: 'IA',
                    checked: /IA/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: 'IB',
                    checked: /IB/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: 'IC',
                    checked: /IC/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: 'IAB',
                    checked: /XAB/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: 'IAC',
                    checked: /XAC/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: 'IBC',
                    checked: /XBC/.test(beCheckString),
                    type,
                    num
                },
                {
                    label: '3I0',
                    checked: /3I0/.test(beCheckString),
                    type,
                    num
                }
            ];
        }
    }
    if (type === 'switch') {
        menuTitle.value = '开关' + num;
        let listData = form.value.switch[num];
        menuList.value = [
            {
                label: '选择调试',
                checked: !!listData,
                type,
                num
            }
        ];
    }
    let pos = document.querySelector('#E800tSvg').getBoundingClientRect();
    menuTop.value = e.clientY - pos.top;
    menuLeft.value = e.clientX - pos.left;
    if (menuList.value.length || selectList.value.length) {
        menuVisible.value = true;
    }
};

const menuSelect = (e, item) => {
    e.checked = !e.checked;
    // 这里需要确保有合适的事件触发机制
    // this.$emit('dataChange') 在 Vue 3 中需要使用自定义事件
    for (let oneIndex in switchExclusiveList1) {
        if (switchExclusiveList1[oneIndex] === parseInt(item.num)) {
            for (let switchNum in form.value.switch) {
                for (let oneIndex2 in switchExclusiveList1) {
                    if (form.value.switch[switchNum] === 1 && switchExclusiveList1[oneIndex2] === parseInt(switchNum)) {
                        form.value.switch[switchNum] = '';
                    }
                }
            }
        }
    }
    for (let twoIndex in switchExclusiveList2) {
        if (switchExclusiveList2[twoIndex] === parseInt(item.num)) {
            for (let switchNum in form.value.switch) {
                for (let twoIndex2 in switchExclusiveList2) {
                    if (form.value.switch[switchNum] === 1) {
                        if (switchExclusiveList2[twoIndex2] === parseInt(switchNum)) {
                            form.value.switch[switchNum] = '';
                        }
                    }
                }
            }
        }
    }
};

const closeMenu = () => {
    menuVisible.value = false;
    menuList.value = [];
    menuTitle.value = '';
    selectList.value = [];
    selectTitle.value = '';
};

const switchShow = (num) => {
    return viewForm.value.switchList[num] ? '#c-kg-off' : '#c-kg';
};

const scSwitchShow = (num) => {
    return viewForm.value.switchList[num] ? '#c-sgkg-off' : '#c-sgkg';
};

const createWebSocket = () => {
    if (route.name !== 'e800tDataView') {
        return;
    }
    const url = `ws://${window.location.host}/dianli/stationMonitorWs/${stationId.value}`;
    try {
        const websocket = new WebSocket(url);
        initWebSocket(websocket);
    } catch (e) {
        console.log('catch' + e);
        reconnect();
    }
};

const initWebSocket = (websocket) => {
    websocket.onopen = (event) => {
        console.log('WebSocket:已连接');
        linkStatus.value = 1;
    };

    websocket.onmessage = (event) => {
        if (event.data) {
            let res = JSON.parse(event.data);
            if (res.msgType === 8) {
                let resData = JSON.parse(res.msgContent);
                setFormData(resData, 'viewForm');
                console.info('测试台实时数据：' + res.msgContent);
                for (let key in resData.effectDiagramMap) {
                    if (key === 'A') {
                        elecFlowCurrentIndexA.value = resData.effectDiagramMap.A;
                    } else if (key === 'B') {
                        elecFlowCurrentIndexB.value = resData.effectDiagramMap.B;
                    } else if (key === 'C') {
                        elecFlowCurrentIndexC.value = resData.effectDiagramMap.C;
                    }
                }
                elecFlowTimer.value = setTimeout(() => {
                    elecFlowCurrentIndexA.value = 0;
                    elecFlowCurrentIndexB.value = 0;
                    elecFlowCurrentIndexC.value = 0;
                }, 5000);
            } else if (res.msgType === 11) {
                let resData = JSON.parse(res.msgContent);
                setTestCanStatus(resData);
            } else if (res.msgType === 9) {
                let resData = JSON.parse(res.msgContent);
                // 测试台单次测试结果，提示客户
                const { confirm } = window.$confirm;
                confirm('有新的测试报表生成', '提示', {
                    confirmButtonText: '查看',
                    cancelButtonText: '忽略',
                    type: 'warning'
                }).then(() => {
                    router.push(`/e800tReportView?stationId=${stationId.value}&id=${resData.id}`);
                }).catch(() => { });
            }
        }
    };

    websocket.onerror = (event) => {
        console.log('WebSocket:发生错误');
        linkStatus.value = 0;
        reconnect();
    };

    websocket.onclose = (event) => {
        console.log('WebSocket:已关闭');
        if (linkStatus.value === -1) {
            return;
        }
        linkStatus.value = 0;
        reconnect();
    };

    window.onbeforeunload = () => {
        linkStatus.value = -1;
        websocket.close();
    };
};

const reconnect = () => {
    let lockReconnect = false;
    if (lockReconnect) {
        return;
    }
    lockReconnect = true;
    let tt;
    clearTimeout(tt);
    tt = setTimeout(() => {
        console.log('重连中...');
        lockReconnect = false;
        createWebSocket();
    }, 4000);
};

const saveTestPlan = () => {
    if (parent.testDevTypeVal === '' || parent.testDevTypeVal === null) {
        window.$message.error('请选择测试类型');
        return;
    }
    if (parent.testAngle === null || String(parent.testAngle) === '') {
        window.$message.error('请填写导通角度');
        return;
    }
    if (parent.testTime === null || String(parent.testTime) === '') {
        window.$message.error('请选择导通时长');
        return;
    }
    let formData = JSON.parse(JSON.stringify(form.value));
    for (let i in formData) {
        for (let j in formData[i]) {
            if (!formData[i][j]) {
                delete formData[i][j];
            }
        }
    }
    if (parent.getFormDataLength(formData.pt) > 4) {
        window.$message.error('监测电压数量不能大于4个');
        return;
    }
    if (parent.getFormDataLength(formData.ct) > 4) {
        window.$message.error('监测电流数量不能大于4个');
        return;
    }
    let params = {
        pt: formData.pt,
        ct: formData.ct,
        switchList: formData.switch,
        testDevType: parent.testDevTypeVal,
        angle: parent.testAngle,
        time: parent.testTime
    };

    const { confirm } = window.$confirm;
    confirm('是否保存为新的配置方案？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(() => {
        parent.curConfigData = params;
        parent.addConfigModal = true;
    }).catch(() => { });
};

const setFormData = (resData, formName) => {
    for (let key in resData) {
        if (key === 'pt') {
            for (let child in resData[key]) {
                let item = resData[key][child];
                let str = JSON.stringify(item).replace(/["\{\}]/g, '');
                resData[key][child] = str;
            }
            resData.viewPt = resData.pt;
        }
        if (key === 'ct') {
            for (let child in resData[key]) {
                let item = resData[key][child];
                let str = JSON.stringify(item).replace(/["\{\}]/g, '');
                resData[key][child] = str;
            }
            resData.viewCt = resData.ct;
        }
        if (key === 'switchList') {
            let switchObj = {};
            for (let i = 1; i < 35; i++) {
                switchObj[i] = resData[key][i] ? 1 : '';
            }
            resData.switchList = switchObj;
        }
    }
    viewForm.value = resData;
};

const setTestCanStatus = (resData) => {
    console.log('接收到预备执行的响应:' + JSON.stringify(resData));
    for (let key in resData) {
        if (key === 'status') {
            if (resData[key] === 1) {
                parent.exetBtnCountDownSc = 60;
                parent.canStart = true;
                parent.exetButtonTimer = setInterval(() => {
                    parent.exetBtnCountDownSc--;
                    parent.exetLabelTxt = '请于' + parent.exetBtnCountDownSc + '秒内点击“测试开始”按钮';
                    if (parent.exetBtnCountDownSc <= 0) {
                        parent.canStart = false;
                        parent.exetLabelTxt = '请点击上方“预备执行”按钮提交测试方案';
                        console.log('倒计时停止:' + parent.exetBtnCountDownSc);
                        clearInterval(parent.exetButtonTimer);
                    }
                }, 1000);
            } else if (resData[key] === 2) {
                console.log('---:' + resData[key]);
                parent.canStart = false;
                parent.exetLabelTxt = '测试平台正在执行其它测试，请等候或联系现场安全员';
            } else if (resData[key] === 3) {
                parent.canStart = false;
                parent.exetLabelTxt = '为保证操作安全，方案需要现场安全员批准，请等待';
            } else if (resData[key] === 0) {
                parent.canStart = false;
                parent.exetLabelTxt = '测试方案不正确，请修改或联系现场安全员';
            }
        }
    }
};

// 监听menuVisible
watch(menuVisible, (value) => {
    if (value) {
        document.body.addEventListener('click', closeMenu);
    } else {
        document.body.removeEventListener('click', closeMenu);
    }
});

// 监听menuList
watch(
    menuList,
    () => {
        if (menuList.value.length) {
            let val = menuList.value
                .filter((item) => item.checked)
                .map((item) => item.label)
                .toString();
            let type = menuList.value[0].type;
            if (val) {
                form.value[type][menuList.value[0].num] = type === 'switch' ? 1 : val;
            } else {
                form.value[type][menuList.value[0].num] = 0;
            }
        }
    },
    { deep: true }
);

// 监听form
watch(
    form,
    () => {
        let data = [];
        let switchList = [];
        for (let key in form.value) {
            for (let d in form.value[key]) {
                let deviceData = form.value[key][d];
                if (deviceData) {
                    let deviceName = key.toUpperCase();
                    if (deviceName === 'SWITCH') {
                        switchList.push(d);
                    } else if (deviceName === 'PT' || deviceName === 'CT') {
                        data.push(deviceName + d + '选择了：' + deviceData);
                    }
                }
            }
        }
        if (switchList.length) {
            data.push(`开关${switchList.toString()}选择了：闭合`);
        }
        testConfigData.value = data;
    },
    { deep: true }
);

// 生命周期钩子
onMounted(() => {
    stationId.value = route.query.id;
    entId.value = route.query.entId;
    // run();
    // createWebSocket();
});

onBeforeUnmount(() => {
    linkStatus.value = -1;
    if (typeof websocket !== 'undefined') {
        websocket.close();
    }
    clearInterval(elecFlowTimer.value);
});

</script>

<style lang="scss" scoped>
.E800tSvgClass {
    transform: scale(1);

    .contextmenu {
        margin: 0;
        background: #fff;
        z-index: 100;
        position: absolute;
        list-style-type: none;
        padding: 5px 0;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 400;
        color: #333;
        box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);

        li {
            margin: 0;
            min-width: 140px;
            cursor: pointer;
            border-top: 1px solid #ededed;

            &:hover {
                background: #eee;
            }
        }

        .el-checkbox {
            display: block;
            padding: 7px 16px;
        }

        .menu-title {
            padding: 5px 0;
            color: #2c77da;
            text-align: center;
            font-size: 14px;
            font-weight: bold;
        }

        .select-content {
            padding: 10px 20px 10px 20px;
            display: flex;
            align-content: center;

            .label {
                line-height: 32px;
            }

            .el-select {
                width: 100px;
            }
        }
    }

    .test-config {
        position: absolute;
        top: 600px;
        right: 602px;
        width: 250px;
        color: #00CC33;

        .title {
            font-size: 18px;
            text-align: center;
            margin-bottom: 10px;
        }

        .config-item {
            font-size: 14px;
            line-height: 24px;
        }
    }

    .circle-load-rect-svg {
        width: 1350px;
        margin: 10px;
    }

    .g-rect-path {
        fill: none;
        stroke-width: 3;
        stroke-linejoin: round;
        stroke-linecap: round;
    }

    .g-rect-fill {
        fill: none;
        stroke-width: 5;
        stroke-linejoin: round;
        stroke-linecap: round;
        stroke-dasharray: 3, 20;
        stroke-dashoffset: 10;
        animation: lineMove 10s cubic-bezier(0, 0, 0.74, 0.74) infinite;

    }

    @keyframes lineMove {
        0% {
            // 定义电流的方向和快慢
            stroke-dashoffset: 850;
        }

        100% {
            stroke-dashoffset: -0;
        }
    }
}

</style>
